package com.example.insurance_service.service.img;

import com.example.insurance_service.dao.InsuranceTypeDao;
import com.example.insurance_service.domain.InsuranceType;
import com.example.insurance_service.service.InsuranceTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class InsuranceTypeServiceimg implements InsuranceTypeService {

    @Autowired
    private InsuranceTypeDao insuranceTypeDao;

    @Override
    public List<InsuranceType> findAll() {
        return insuranceTypeDao.findAll();
    }

    @Override
    public InsuranceType findAllById(Integer insuranceTypeId) {
        final List<InsuranceType> list = insuranceTypeDao.findAllById(Collections.singleton(insuranceTypeId));

        return list.get(0);
    }
}
